package com.jlcindia;

public class OOPTest10 {
	public static void main(String[] args) {
		Student st1=new Student();
		st1.sid=99;
		st1.name="ravi";
		Student st2=new Student();
		st2.sid=88;
		st2.name="kumar";
		System.out.println("\n main st1:"+st1);
		st1.search("JLC-001");
		System.out.println("\n In main st2:"+st2);
		st2.search("JLC-002");
	}
}
class Student{
	int sid;
	String name;
	void search(String sid){
		System.out.println("\n**search() called**:"+this);
		System.out.println("sid:"+sid);//sid is local variable here
		System.out.println("name:"+name);//points to current object data because it invokes with st1 object reference
		//System.out.println(st1.sid);
		Student st=new Student();//new object in new location created
		System.out.println("st.sid:"+st.sid);//points to new object in heap memory
		System.out.println("st.name:"+st.name);//points to new object in heap memory
		System.out.println("this.name:"+this.name);//points to current object data,object from which method invokes
		System.out.println("this.sid:"+this.sid);
		Student stud=this;//this keyword is current class type
		System.out.println("stud:"+stud);
		System.out.println("stud.name:"+stud.name);
		System.out.println("stud.sid:"+stud.sid);
		stud=null;
		System.out.println(":"+Student.this.sid);
		System.out.println(":"+Student.this.name);
		//this=null;
		//this();*/
		
	}
}
class Abc{
	void display(){
		Abc ref=this;
		//Student st=this;//this is always current class type	
	}
}